package com.swizipuremvc.core.wrappers
{
	public class TimeWrapper
	{
		public var hour:String;
		public var minutes:String;
		public var ampm:String;
		
		public function hourToAmPm(hour:Number):String
		{
			if(hour<= 11 && hour>= 0)
			{
				return "am";
			}
			else
			{
				return "pm";
			}
		}
		
		public function convertAmPm(hour:String,ampm:String):String
		{
			switch(ampm)
			{
				case "pm":
				{
					switch(hour)
					{
						case "1":
						{
							return "13";
							break;
						}
						case "14":
						{
							return "2";
							break;
						}
						case "3":
						{
							return "15";
							break;
						}
						case "4":
						{
							return "16";
							break;
						}
						case "5":
						{
							return "17";
							break;
						}
						case "6":
						{
							return "18";
							break;
						}
						case "7":
						{
							return "19";
							break;
						}
						case "8":
						{
							return "20";
							break;
						}
						case "9":
						{
							return "21";
							break;
						}
						case "10":
						{
							return "22";
							break;
						}
						case "11":
						{
							return "23";
							break;
						}
							
					}
					break;
				}
				case "am":
				{
					if(hour == "12")
					{
						return "0";
					}
					break;
				}
			}
			
			return hour;
			
		}
	}
}